// 这里全部是接口封装
import http from './index'

// -----------------------菜单接口-----------------
// 菜单列表
export const menulist = (data: any) => http.get('/menulist', data)
// 菜单添加
export const menuadd = (data: any) => http.post('/menuadd', data)
// 菜单获取（一条）
export const menuinfo = (data: any) => http.get('/menuinfo', data)
// 菜单修改
export const menuedit = (data: any) => http.post('/menuedit', data)
// 菜单删除
export const menudelete = (data: any) => http.post('/menudelete', data)

// ----------------------角色接口---------------------
// 角色添加
export const roleadd = (data: any) => http.post('/roleadd', data)
// 角色列表
export const rolelist = () => http.get('/rolelist')
// 角色获取（一条）
export const roleinfo = (data: any) => http.get('/roleinfo', data)
// 角色修改
export const roleedit = (data: any) => http.post('/roleedit', data)
// 角色删除
export const roledelete = (data: any) => http.post('/roledelete', data)

// -----------------------管理员接口--------------------------------
// 管理员添加
export const useradd = (data: any) => http.post('/useradd', data)
// 管理员总数（用于计算分页）
export const usercount = () => http.get('/usercount')
// 管理员列表（分页）
export const userlist = (data: any) => http.get('/userlist', data)
// 管理员获取（一条）
export const userinfo = (data: any) => http.get('/userinfo', data)
// 管理员修改
export const useredit = (data: any) => http.post('/useredit', data)
// 管理员删除
export const userdelete = (data: any) => http.post('/userdelete', data)
// 登录接口
export const userlogin = (data: any) => http.post('/userlogin', data)

// --------------------------商品分类-----------------------------------
// 商品分类添加
export const cateadd = (data:any) => http.post('/cateadd',data,true)
// 商品分类列表
export const catelist = () => http.get('/catelist?istree=true')
// 商品分类获取（一条）
export const cateinfo = (data:any) => http.get('/cateinfo',data)
// 商品分类修改
export const cateedit = (data:any) =>http.post('cateedit',data,true)
// 商品分类删除
export const catedelete = (data:any) => http.post('/catedelete',data)

//=============================商品规格管理============================
//商品规格添加
export const specsadd = (data: object) => http.post('/specsadd', data)
//商品规格总数（用于计算分页）
export const specscount = () => http.get('/specscount')
//商品规格列表（分页）
export const specslist = (data: object) => http.get('/specslist', data)
//商品规格获取（一条）
export const specsinfo = (data: object) => http.get('/specsinfo', data)
//商品规格修改
export const specsedit = (data: object) => http.post('/specsedit', data)
//商品规格删除
export const specsdelete = (data: object) => http.post('/specsdelete', data)

// ------------------------------商品管理----------------------------------
// 商品管理添加
export const goodsadd = (data:any) => http.post('/goodsadd',data,true)
// 商品总数（用于计算分页）goodscount
export const goodscount = () => http.get('/goodscount')
// 商品列表（分页）
export const goodslist = (data:any) => http.get('/goodslist',data)
// 商品获取（一条）
export const goodsinfo = (data:any) => http.get('/goodsinfo',data)
// 商品修改
export const goodsedit = (data:any) => http.post('/goodsedit',data,true)
// 商品删除
export const goodsdelete = (data:any) => http.post('/goodsdelete',data)

// --------------------------------会员管理---------------------------------
// 会员列表
export const memberlist = () => http.get('/memberlist')
// 会员获取（一条）
export const memberinfo = (data:object) => http.post('/memberinfo',data)
// 会员修改
export const memberedit = (data:object) => http.post('/memberedit',data)
